Skip to main content
Version: V4.0

Scene Management API


Get Scene List

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
page_sizeIntegerBodyYesPage size
page_indexIntegerBodyYesPage index

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
result[]Object<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
scene_idStringBodyScene ID
scene_nameStringBodyScene name
enable_autoBooleanBodyWhether the scene automation is enable or not?
true: enable
false: disable

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "get_scene_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"enable_auto": true
}
]
}

Failure Return Example

See Failure Return Example



Get Scene Information

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_idStringBodyYesScene ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
scene_nameStringBodyScene name
triggers[]Object<trigger>BodyTrigger information
actions[]Object<action>BodyAction information

trigger description

Parameter NameTypeLocationDescription
trigger_configStringBodyTrigger config, see Scene Trigger Config
trigger_typeStringBodyTrigger type, see Scene Trigger Config
room_tag_idStringBodyRoom tag ID

action description

Parameter NameTypeLocationDescription
action_configStringBodyAction config, see Scene Action Config
ability_typeStringBodyAbility type
action_typeStringBodyAction type, see Scene Action Config
attributeObjectBodyAttribute, see Standard Device Model

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "get_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_name": "my scene",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in",
"room_tag_id": ""
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
]
}

Failure Return Example

See Failure Return Example



Create Scene Information

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_nameStringBodyYesScene name
triggers[]Object<trigger>BodyYesTrigger information
actions[]Object<action>BodyYesAction information

trigger description

Parameter NameTypeLocationRequiredDescription
trigger_configStringBodyYesTrigger config, see Scene Trigger Config
trigger_typeStringBodyYesTrigger type, see Scene Trigger Config
room_tag_idStringBodyNoRoom tag ID

action description

Parameter NameTypeLocationRequiredDescription
action_configStringBodyYesAction config, see Scene Action Config
ability_typeStringBodyYesAbility type
action_typeStringBodyYesAction type, see Scene Action Config
attributeObjectBodyNoAttribute, see Standard Device Model

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObject<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
scene_idStringBodyScene ID

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "create_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_name": "test",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in"
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5"
}
}

Failure Return Example

See Failure Return Example



Update Scene Information

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_idStringBodyYesScene ID
scene_nameStringBodyYesScene name
triggers[]Object<trigger>BodyYesTrigger information
actions[]Object<action>BodyYesAction information

trigger description

Parameter NameTypeLocationRequiredDescription
trigger_configStringBodyYesTrigger config, see Scene Trigger Config
trigger_typeStringBodyYesTrigger type, see Scene Trigger Config
room_tag_idStringBodyNoRoom tag ID

action description

Parameter NameTypeLocationRequiredDescription
action_configStringBodyYesAction config, see Scene Action Config
ability_typeStringBodyYesAbility type
action_typeStringBodyYesAction type, see Scene Action Config
attributeObjectBodyNoAttribute, see Standard Device Model

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn result

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "update_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5",
"scene_name": "test",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in"
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {}
}

Failure Return Example

See Failure Return Example



Delete Scene Information

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_idStringBodyYesScene ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn result

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {}
}

Failure Return Example

See Failure Return Example



Manual Trigger Scene

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_idStringBodyYesScene ID
residences[]Object<residence>BodyYesResidence information

residence description

Parameter NameTypeLocationRequiredDescription
residence_idStringBodyYesResidence ID

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn result

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s3b5a73f8dd84abaa94dcs248be49b0db",
"residences": [
{
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
]
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {}
}

Failure Return Example

See Failure Return Example



Enable Auto Scene

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
scene_idStringBodyYesScene ID
enable_autoBooleanBodyYesWhether the scene automation is enable or not?
true: enable
false: disable

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
resultObjectBodyReturn result

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s3b5a73f8dd84abaa94dcs248be49b0db",
"enable_auto": true
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": {}
}

Failure Return Example

See Failure Return Example



Get Scene History

Request URL

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Request Parameter

Parameter NameTypeLocationRequiredDescription
Content-TypeStringHeaderYesContent type, the value is application/json
AcceptStringHeaderYesAccept, the value is application/json
AuthorizationStringHeaderYesBearer authorization, access token
commandStringBodyYesCommand name
idStringBodyYesCommand ID
paramObject<param>BodyYesCommand parameter

param description

Parameter NameTypeLocationRequiredDescription
page_sizeIntegerBodyYesPage size
page_indexIntegerBodyYesPage index

Return Parameter

Parameter NameTypeLocationDescription
Content-TypeStringHeaderContent type, the value is application/json
successBooleanBodyWhether the request is successful or not?
true: success
false: failure
timestampIntegerBodyTimestamp
result[]Object<result>BodyReturn result

result description

Parameter NameTypeLocationDescription
scene_record_idStringBodyScene record ID
scene_idStringBodyScene ID
scene_nameStringBodyScene name
trigger_sceneBooleanBodyWhether the scene triggering is successful or not?
true: success
false: failure
residence_idStringBodyResidence ID
detailObject<detail>BodyDetail information

detail description

Parameter NameTypeLocationDescription
trigger_configStringBodyTrigger config, see Scene Trigger Config
trigger_typeStringBodyTrigger type, see Scene Trigger Config
room_tag_idStringBodyRoom tag ID
manualBooleanBodyWhether the scene is manual or not?
true: yes
false: no
manual_byStringBodyManual by

Request Example

POST /api/v1.0/invoke/open-ability/method/hotel-commands

Content-Type: application/json

Accept: application/json

Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9

{
"command": "get_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1
}
}

Success Return Example

Status Code: 200

Content-Type: application/json

{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_record_id": "r8b5a73f8dd84abaa94dcs248be49b0d1",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"trigger_scene": true,
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"detail": {
"trigger_config": "hotel",
"trigger_type": "check_in",
"room_tag_id": "",
"manual": false,
"manual_by": ""
}
}
]
}

Failure Return Example

See Failure Return Example